<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta name="apple-mobile-web-app-capable" content="no">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="format-detection" content="telephone=no,email=no">
    <meta name="apple-mobile-web-app-status-bar-style" content="white">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title></title>
    <script type="text/javascript" src="<%=request.getAttribute("StaticHost")%>/js/jquery.js"></script>
    <script type="text/javascript" src="<%=request.getAttribute("StaticHost")%>/hb/jquery.min.js"></script>
    <script type="text/javascript" src="<%=request.getAttribute("StaticHost")%>/js/jquery.qrcode.min.js"></script>
    <meta name="__hash__" content="d51c55e634edcc0156e0b2131de1dcea_c7ed39a906efdef57fe6fe763b7bcf0d">
    <style>
        .body {
            line-height: 1.333;
            font-size: 12px
        }
        .mod-ct {
            min-width: 300px;
            max-width: 640px;
            margin: 0 auto;
            margin-top: 15px;
            margin-bottom: 15px;
            padding-bottom: 10px;
            background: #fff;
            text-align: center;
            color: #333;
            border: 1px solid #e5e5e5;
            border-top: none
        }
        .mod-ct .order {
            font-size: 16px;
            padding-top: 10px
        }
        .mod-ct .amount {
            font-size: 35px;
            margin-top: 5px;
            font-weight: 700;
        }

        .logo{
            display: inline-block;
            width: 160px;
            height: 80px;
            vertical-align: middle;
            margin-right: -50px;
            position: relative;
            bottom: 10px;
        }
        .mod-title {
            min-width: 300px;
            max-width: 640px;
            margin: 0 auto;
            height: 60px;
            line-height: 60px;
            text-align: center;
            border-bottom: 1px solid #ddd;
            background: #fff;
            position: relative;
        }
    </style>
</head>
<%
String pay_url = (String) request.getAttribute("pay_url");
String money = (String) request.getAttribute("money");
    String tradeNo = (String) request.getAttribute("tradeNo");
%>
<body style="background: #f7f7f7;">
<div class="body">
    <h1 class="mod-title" style="overflow: hidden;">
        <span class="logo" style="background:url(http://static.bolinvision.com/img/alipayImg.png) no-repeat 100% 100%;background-size: cover;"></span>
    </h1>
    <div class="mod-ct">
        <div class="order" >
            订单号：<%=tradeNo%>
        </div>
        <div class="amount" id="money"><strong>￥<%=money%></strong></div>
        <div style="color: rgb(0, 167, 239);font-size: 14px;margin-top: 5px;font-weight: bold;">请勿修改金额和备注，否则充值不到账!</div>
        <div style="color: red;margin-top: 8px;font-size: 14px;">
            支付倒计时 : <strong id="djs" style="color: green">00:03:50</strong> 过期无法到账
        </div>
        <!--支付宝app支付-->
        <div data-role="qrPayImgWrapper" style="margin-top: 12px;">
            <div data-role="qrPayImg" class="qrcode-img-area">
                <div class="ui-loading qrcode-loading" data-role="qrPayImgLoading" style="display: none;"></div>
                <div style="position: relative;display: inline-block;" id="code">

                </div>
            </div>
        </div>
        <h2 id="info3"></h2>
        <h3 style="color: #FF0000;" id="info1">1：保存图片或者截屏，打开支付宝扫一扫</h3>
        <p style="color: #FF0000;font-size: 14px;" id="info2">*此二维码只提供本次充值，过期作废，请勿重复充值*</p>
        <p style="font-size: 12px;font-weight: bold;">付款10分钟未到账 请联系在线客服<br>

            遇到任何问题请咨询平台客服, 不要留言收款号</p>

        <!--微信内支付-->
    </div>
</div>
<script type="text/javascript">
    $('#code').qrcode({
        render: "canvas",
        text: "<%=pay_url%>"
    });
    window.onload=function(){
        var mobile_flag = isMobile(); // false为PC端，true为手机端
        if(mobile_flag){
            // document.getElementById("paybtn").style.display="";
        }else{
            // document.getElementById("paybtn2").style.display="";
        }
    };
    function isMobile() {
        var userAgentInfo = navigator.userAgent;
        var mobileAgents = [ "Android", "iPhone", "SymbianOS", "Windows Phone", "iPad","iPod"];
        var mobile_flag = false;
        //根据userAgent判断是否是手机
        for (var v = 0; v < mobileAgents.length; v++) {
            if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
                mobile_flag = true;
                break;
            }
        }
        var screen_width = window.screen.width;
        var screen_height = window.screen.height;
        //根据屏幕分辨率判断是否是手机
        if(screen_width < 500 && screen_height < 800){
            mobile_flag = true;
        }
        return mobile_flag;
    }

    var timeOut = 230;//
    var timer = setInterval(function(){
        timeOut -= 1;
        var pringTime = "";
        var mm = parseInt(timeOut/60);
        var mmStr = mm < 10 ? "0"+mm:mm+""
        if(timeOut%60 < 10){
            printTime = "00:"+mmStr+":0"+timeOut%60
        }else{
            printTime = "00:"+mmStr+":"+timeOut%60
        }
        $("#djs").text(printTime);
        if(timeOut <= 0){
            clearInterval(timer)
            $("#code").empty();
            $("#info1").hide();
            $("#info2").hide();
            $("#info3").text("订单超时,请重新下单");
            return;
        }
        /*if(timeOut < 200&&timeOut%5 == 0){
            $.ajax({
                type : "PUT",
                url : location.href,
                data:{
                },
                success : function(r) {
                    console.log(r);
                    if (r == "success") {
                        clearInterval(timer);
                        $("#cQrCode").empty();
                        $("#imagQrDiv").empty();
                        $("#imagQrDiv").text("订单支付成功!");
                        $("#payButton1").hide();
                        $("#payButton").hide();
                        if(reUrl != "")location.href = reUrl + "?orderNo=" + orderNo;
                    }else{
                        return;
                    }
                }
            })
        }*/
        console.log(timeOut);
    },1000);
</script>

</body></html>